<!DOCTYPE html>
<html>
<head>
    <title>Stacked and grouped bars</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" >

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.dataviz.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.dataviz.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
    
        <div id="example" class="k-content">
            <div class="chart-wrapper">
                <div id="chart"></div>
            </div>
            <script>
                function createChart() {
                    $("#chart").kendoChart({
                        theme: $(document).data("kendoSkin") || "default",
                        title: {
                            text: "World population by age group and sex"
                        },
                        legend: {
                            visible: false
                        },
                        seriesDefaults: {
                            type: "column"
                        },
                        series: [{
                            name: "0-19",
                            stack: "Female",
                            data: [1100941, 1139797, 1172929, 1184435, 1184654]
                        }, {
                            name: "20-39",
                            stack: "Female",
                            data: [810169, 883051, 942151, 1001395, 1058439]
                        }, {
                            name: "40-64",
                            stack: "Female",
                            data: [395533, 435485, 499861, 569114, 655066]
                        }, {
                            name: "65-79",
                            stack: "Female",
                            data: [152171, 170262, 191015, 210767, 226956]
                        }, {
                            name: "80+",
                            stack: "Female",
                            data: [36724, 42939, 46413, 54984, 66029]
                        }, {
                            name: "0-19",
                            stack: "Male",
                            data: [1155600, 1202766, 1244870, 1263637, 1268165]
                        }, {
                            name: "20-39",
                            stack: "Male",
                            data: [844496, 916479, 973694, 1036548, 1099507]
                        }, {
                            name: "40-64",
                            stack: "Male",
                            data: [390590, 430666, 495030, 564169, 646563]
                        }, {
                            name: "65-79",
                            stack: "Male",
                            data: [120614, 138868, 158387, 177078, 192156]
                        }, {
                            name: "80+",
                            stack: "Male",
                            data: [19442, 23020, 25868, 31462, 39223]
                        }],
                        seriesColors: ["#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad",
                                       "#009bd7", "#26aadd", "#4db9e3", "#73c8e9", "#99d7ef"],
                        valueAxis: {
                            labels: {
                                template: "#= kendo.format('{0:N0}', value / 1000) # M"
                            }
                        },
                        categoryAxis: {
                            categories: [1990, 1995, 2000, 2005, 2010]
                        },
                        tooltip: {
                            visible: true,
                            template: "#= series.stack #s, age #= series.name #"
                        }
                    });
                }

                $(document).ready(function() {
                    setTimeout(function() {
                        // Initialize the chart with a delay to make sure
                        // the initial animation is visible
                        createChart();

                        $("#example").bind("kendo:skinChange", function(e) {
                            createChart();
                        });
                    }, 400);
                });
            </script>
        </div>

</body>
</html>
